{extend name="public/base" /}

{block name="pjax_container"}
<?php
    $titleTypeName = '预览排名';
?>
<style>
 
.content-header>.breadcrumb>li{
    color: #999;
}
.content-header>.breadcrumb>.active{
    color: #666;
}
.content-header{
    height: 51px;
 
}
.btn-primary{
      background-color: #1890FF;
    color: #fff;
    border: none;
    border-radius: 6px !important;
    margin-left: 15px;
    padding: 5px 10px; 
    line-height: 24px;
}
.box-primary{
  border-top-color: #ecf0f5 !important;

  
}
.btn-primary:hover{
     background-color: #1890FF;
    color: #fff;
    border: none;
    opacity: .9;
    border-radius: 6px !important; 
}
.delete-one{
    background-color: ff4141 !important;
    margin-left: 15px;
    border-radius: 6px;
}
.sreachs{
       background-color: #1890FF;
    color: #fff;
    border: none;
    border-radius: 6px !important;
    margin-left: 15px;
    padding: 7px 15px; 
}
a{
    margin-right: 10px;
}
.timepicker{
    border: none;
    margin: 0 10px;
    line-height: 35px;
    text-align: center;
    border: 1px solid #ccc;

}
.timepicker1{
    border: none;
    margin: 0 10px;
    line-height: 35px;
    text-align: center;
    border: 1px solid #ccc;

}
.content{
    margin-top: -25px;
}
tr>th,td{
    text-align: center;
}

.group_tags_ul{
    display: flex;
    flex-wrap: wrap;
    padding-left: 20px;
    padding-top: 10px;
}
.group_tags_ul span{
    color: #1890FF;
}
.group_tags_ul li{
    cursor: pointer;
    padding: 0 10px;
    border-right: 1px solid rgba(153, 153, 153, 0.3)
}
.group_tags_ul li:last-child{
    border-right:none;
}
.group_tags_ul .active{
    color: #1890FF;
}
</style>
<section class="content-header">
    <!--<ol class="breadcrumb">
    <li class="pull-right"><a href="{:url('reportset/custom_report')}" class="btn btn-sm" style="padding:10px 2px;"><i class="fa fa-list"></i> 返回</a></li>
    </ol>-->
</section>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="box box-primary">

                <div class="box-tools" style="margin:5px;">
                    <form id="form1" action="{:search_url(['s_time', 'e_time'])}" method="GET" pjax-search="">
                        <div class="input-group input-group-sm">
                            <div>
                                <a href="{:url('reportset/custom_report_ranking', ['id'=>input('id'), 'act'=>'y'])}">
                                    <button type="button" class="btn btn-default sreachs">月份排名</button>
                                </a>
                                <a href="{:url('reportset/custom_report_ranking', ['id'=>input('id'), 'act'=>'j'])}">
                                    <button type="button" class="btn btn-default sreachs">阶段排名</button>
                                </a>
                                <a href="{:url('reportset/custom_report_ranking', ['id'=>input('id'), 'act'=>'l'])}">
                                    <button type="button" class="btn btn-default sreachs">累计排名</button>
                                </a>
                                {if condition="$act == 'y'"}
                                <input class="timepicker" name="s_time" value="{$s_time}" placeholder="" AUTOCOMPLETE="off">
                                {/if}
                                {if condition="$act == 'j'"}
                                <input class="timepicker1" name="s_time" value="{$s_time}" placeholder="" AUTOCOMPLETE="off">
                                <label style="margin-bottom:0;" for="">至</label>
                                <input class="timepicker1" name="e_time" value="{$e_time}" placeholder="" AUTOCOMPLETE="off">
                                {/if}
                                {if condition="$act != 'l'"}
                                <div class="input-group-btn" style="display: inline-block;">
                                    <button type="submit" class="btn btn-default sreachs">
                                        <i class="fa fa-search"></i>查询
                                    </button>
                                </div>
                                {/if}
                            </div>
                        </div>
                    </form>
                </div>

                <div class="box-header with-border">
                    <div class="pull-left">
                        <a href="javascript:xls_explode();" class="btn btn-sm btn-primary"> 导出</a>
                    </div>
                </div>
                <!--<div class="group_tags">-->
                    <!--<ul class="group_tags_ul">-->
                        <!--{if condition="$type == 1"}-->
                        <!--<span>平均分报表</span>-->
                        <!--{else}-->
                        <!--{volist name="groupNames" id="group_name" key="k"}-->
                        <!--<li class="{$k==1 ? 'active':''}">{$group_name}</li>-->
                        <!--{/volist}-->
                        <!--{/if}-->
                    <!--</ul>-->
                <!--</div>-->
                <div class="box-body table-responsive">
                    <table class="table table-bordered table-hover">
                        {switch name="$type" }
                        {case value="0"}{include file="reportset/custom_report_ranking0"/}{/case}
                        {case value="1"}{include file="reportset/custom_report_ranking1"/}{/case}
                        {/switch}
                    </table>
                </div>
                <div class="box-footer clearfix">

                </div>
            </div>
        </div>
    </div>
</section>
<script>
    $(".group_tags li").click(function () {
        var index = $(".group_tags ul li").index(this);
        index++;
        var item_name = "group_list"+index;
        if ($("."+item_name+"").length == 0) {
            $(".table tr").hide();
        }else{
            $("."+item_name+"").siblings().hide();
            $("."+item_name+"").show();
        }
        $(".group_list_head").show();
        $(this).addClass("active");
        $(this).siblings().removeClass("active");
    })
</script>
<script>
    $(function(){

        $(".select2").select2({language:"zh-CN"});
        var now = new Date();
        var currentYear=now.getFullYear();
        var startDate = new Date(currentYear,0,1);
        var endDate = new Date(currentYear+1,0,1);
        $('.timepicker').datetimepicker({
            format: "{$timepickerFormat | default='YYYY-MM'}",   //YYYY-MM-DD HH:mm:ss
            locale: moment.locale('zh-cn'),
            // minDate:startDate,
            maxDate : endDate
        });
        $('.timepicker1').datetimepicker({
            format: "{$timepickerFormat | default='YYYY-MM-DD'}",   //YYYY-MM-DD HH:mm:ss
            locale: moment.locale('zh-cn'),
            // minDate:startDate,
            maxDate : endDate
        });
    });

    function xls_explode() {
        window.location.href = "{:url('Reportset/custom_report_ranking')}?" + $('#form1').serialize()+"&export=1&id={:input('id')}&act={$act}";
        return false;
    }
</script>
{/block}
